package client

import (
	"context"
	"mini-app/internal/app/grpc/protoc/system_admin"

	"192.168.1.75/go-pkg/errorx"
	"192.168.1.75/go-pkg/logx"
	"192.168.1.75/go-pkg/svsdis"
)

// GetDeviceAdminClient 获取grpc客户端
func GetSystemAdminClient() (system_admin.BaseServiceClient, error) {
	conn, err := svsdis.GRPCConn("system-admin")
	if err != nil {
		logx.Error(context.Background(), "GetSystemAdminClient err")
		return nil, errorx.New("获取服务失败", -1)
	}
	cli := system_admin.NewBaseServiceClient(conn)
	return cli, nil
}
